using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Routing;
using Microsoft.AspNet.FriendlyUrls;
using System.Web.Mvc;

namespace CanDoo.Oil.WebHost
{
    public static class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            //routes.MapPageRoute("", "", "~/Default.aspx");
            routes.IgnoreRoute("{resource}.aspx");

            FriendlyUrlSettings aspxSettings = new FriendlyUrlSettings();
            aspxSettings.AutoRedirectMode = RedirectMode.Off;  // default=Off  Permanent
            routes.EnableFriendlyUrls(aspxSettings);

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapPageRoute("admin", "a", "~/Admin/Main.aspx", true, new RouteValueDictionary { { "action", "all" } });

            //routes.MapRoute("P", "P/{id}", new { area = "", controller = "Home", action = "Index", id = UrlParameter.Optional });

            //routes.MapRoute(
            //    name: "Default",
            //    url: "{controller}/{action}/{id}",
            //    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            //);
        }
    }
}
